<%@ page import="cqcvc.edu.cn.entity.HouseInfo" %>
<%@ page import="java.util.List" %>
<%@ page import="cqcvc.edu.cn.dao.HouseDao" %>
<%@ page import="cqcvc.edu.cn.entity.ServiceInfo" %>
<%@ page import="cqcvc.edu.cn.entity.ActivityInfo" %><%--
  Created by IntelliJ IDEA.
  User: zhouyz
  Date: 2022/12/27
  Time: 8:46
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>首页</title>
</head>
<body>
<jsp:include page="index-header.jsp"></jsp:include>

<div class="slider row">
    <div class="carousel slide" id="slider" data-ride="carousel" ng-controller="sliderCtrl">
        <ol class="carousel-indicators">
            <li class="active" data-target="#slider" data-slide-to="0"></li>
            <li data-target="#slider" data-slide-to="1"></li>
            <li data-target="#slider" data-slide-to="2"></li>
            <li data-target="#slider" data-slide-to="3"></li>
        </ol>
        <div class="carousel-inner" role="listbox">
            <div class="item active">
                <img src="images/slider2.png" alt="" width="100%" height="400px" />
            </div>
            <div class="item">
                <img src="images/slider4.png" alt="" width="100%" height="400px" />
            </div>
            <div class="item">
                <img src="images/slider5.png" alt="" width="100%" height="400px" />
            </div>
            <div class="item">
                <img src="images/slider3.png" alt="" width="100%" height="400px" />
            </div>
        </div>
        <a href=".slide" class="left carousel-control" role="button" data-slide="prev"> <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span> <span class="sr-only">Previous</span></a>
        <a href=".slide" class="right carousel-control" role="button" data-slide="next"><span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span> <span class="sr-only">next</span></a>
    </div>
</div>

<div class="fast-nav">
    <div >
        <ul class="nav-ul">
            <li><a href="#">快速入口</a></li>
            <li><a href="service.jsp">专业服务</a></li>
            <li><a href="activity.jsp">套餐活动</a></li>
            <li><a href="house.jsp">房间介绍</a></li>
        </ul>
    </div>
</div>
<%
//    HouseDao houseDao=new HouseDao();
    // application.setAttribute("houseInfos",houseInfos);
    //List<HouseInfo> houseInfos=houseDao.findAll(); 修改为从缓存中取数据
    List<HouseInfo> houseInfos=(List<HouseInfo>)application.getAttribute("houseInfos");
    List<ServiceInfo> serviceInfos=(List<ServiceInfo>)application.getAttribute("serviceInfos");
    List<ActivityInfo> activityInfos = (List<ActivityInfo>) application.getAttribute("activityInfos");
%>

<div class="container">
    <div class="more-list">
        <div class="more-list-header">
            <h4>房间介绍</h4> <small>room</small>
            <a href="house.jsp">更多>></a>
        </div>

        <div class="content" style="margin-top: 3px">
            <div class="row">
                <%
                    for(int i=0;i<4 && i<houseInfos.size();i++) {
                %>
                <div class="col-lg-3">
                    <div class="img-thumbnail" style="float: left">
                        <a href="house_detail?id=<%=houseInfos.get(i).getId()%>">
                            <img src="images/houseShowPic?id=<%=houseInfos.get(i).getId()%>" style="height: 195px;width: 260px" class="img-responsive" alt="" /></a>
                        <p><%=houseInfos.get(i).getHouseTitle()%></p>
                    </div>
                </div>
                <%
                    }
                %>
            </div>
        </div>
    </div>
    <div class="more-list">
        <div class="more-list-header">
            <h4>专业服务</h4><small>server</small>
            <a href="service.jsp">更多>></a>
        </div>
        <div class="content" style="margin-top: 3px">
            <div class="row">
                <%
                    for(int i=0;i<4 && i<serviceInfos.size();i++) {
                %>
                <div class="col-lg-3">
                    <div class="img-thumbnail">
                        <a href="service_detail?id=<%=serviceInfos.get(i).getId()%>&typeId=<%=serviceInfos.get(i).getServiceType()%>"><img src="images/serShowPic?id=<%=serviceInfos.get(i).getId()%>" style="height: 195px;width: 260px" class="img-responsive" alt="" /></a>
                        <p><%=serviceInfos.get(i).getSerTitle()%></p>
                    </div>
                </div>
                <%
                    }
                %>

            </div>
        </div>
    </div>
    <div class="more-list">
        <div class="more-list-header">
            <h4>套餐及活动</h4> <small>active</small>
            <a href="activity.jsp">更多>></a>
        </div>
        <div class="content" style="margin-top: 3px">
            <div class="row">
                <%
                    for (int i = 0; i < 4 && i < activityInfos.size(); i++) {
                %>
                <div class="col-lg-3">
                    <div class="img-thumbnail" style="float: left">
                        <a href="activity_detail.jsp?id=<%=activityInfos.get(i).getId()%>"><img src="activity_image_show?id=<%=activityInfos.get(i).getId()%>"
                                                                                         style="height: 195px;width: 260px"
                                                                                         class="img-responsive" alt=""/></a>
                        <p><%=activityInfos.get(i).getActTitle()%></p>
                    </div>
                </div>
                <%
                    }
                %>

            </div>
        </div>
    </div>
</div>

<jsp:include page="index-foot.jsp"></jsp:include>
</body>
</html>
